-- GENERATED SPELL FOR [Dark Rune Controller] --


function spell0_27966(pUnit, Event) --@Crystalline Growth,n/a--
pUnit:FullCastSpellOnTarget(51805,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27966', 16000, 1)
end

function spell1_27966(pUnit, Event) --@Domination,n/a--
pUnit:FullCastSpellOnTarget(51503,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_27966', 10500, 1)
end

function spell2_27966(pUnit, Event) --@Summon Shardling,Self--
pUnit:FullCastSpellOnTarget(51507,pUnit)
pUnit:RegisterEvent('Sorts_27966', 2000, 1)
end

function Sorts_27966(pUnit, Event)
local choix_sorts_27966 = math.random(0, 2)
if choix_sorts_27966 == 0 then
pUnit:RegisterEvent('spell0_27966', 1, 1)
end
if choix_sorts_27966 == 1 then
pUnit:RegisterEvent('spell1_27966', 1, 1)
end
if choix_sorts_27966 == 2 then
pUnit:RegisterEvent('spell2_27966', 1, 1)
end
end

function mob27966_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_27966', math.random(1500, 3000), 1)
end

function mob27966_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27966_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27966_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(27966, 1, 'mob27966_Action')
RegisterUnitEvent(27966, 2, 'mob27966_Leave')
RegisterUnitEvent(27966, 3, 'mob27966_Kill')
RegisterUnitEvent(27966, 4, 'mob27966_Die')
